package com.gzdh.dishrecognition.config;

import android.content.Context;
import android.content.SharedPreferences;

import com.gzdh.dishrecognition.AppContext;

public class SysBluetoothConfig {
    private SharedPreferences sharedPreferences;

    private SharedPreferences.Editor editor;
    private static SysBluetoothConfig sysBluetoothConfig;

    public static SysBluetoothConfig getInstance() {
        if (sysBluetoothConfig == null) {
            sysBluetoothConfig = new SysBluetoothConfig();

        }
        return sysBluetoothConfig;
    }

    public SysBluetoothConfig() {
        sharedPreferences = AppContext.getInstance().getSharedPreferences("sysBluetooth", Context.MODE_PRIVATE); //私有数据
        editor = sharedPreferences.edit();
        address = sharedPreferences.getString("address", "E4:AE:37:36:50:59");
    }

    private String address;


    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
        editor.putString("address", address);
        editor.apply();
    }
}
